import { Component, UITransform, Vec3, _decorator } from "cc";
const { ccclass, property } = _decorator;


@ccclass("Solace")
export class Solace extends Component {

    protected onLoad(): void {
        console.log('启动节点')
        console.log(this.node.position)
        console.log(this.node.worldPosition)
        this.node.removeAllChildren()
    }

    protected update(dt: number): void {

    }

    protected start(): void {
        console.log('开始节点')
        // console.log(this.node.position)
        // console.log(this.node.worldPosition)
        // this.node.removeAllChildren()

        let worldPosition = new Vec3(100, 120);

        let transform = this.node.getComponent(UITransform)

        let out = new Vec3();

        if (transform) {
            console.log("transform数据: " + transform)

            transform.convertToNodeSpaceAR(worldPosition, out)
        }

    }

}